package ch03.shangJi.sj3;

import java.io.Serializable;

public class Stu extends Per implements Serializable {
    private int id;//编号
    private String name;//姓名

    public Stu() {
    }

    public Stu(String name) {
        this.name = name;
    }

    public Stu(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public void sayHello(){
        System.out.println(toString());
    }
    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}